cmake_minimum_required(VERSION 3.10)
project(sys_manager VERSION 1.0.0)

set(CMAKE_CXX_STANDARD 14)

# 导入头文件路径
include_directories(3rd/mosquitto/include)
#include_directories(../../common-rv1126/include/mosquitto)
include_directories(3rd/nlohmann/include)
include_directories(3rd/spdlog/include)
include_directories(3rd/croncpp/include)
include_directories(3rd/yaml-cpp/include)
include_directories(src)

# 导入lib文件路径
if( CMAKE_C_COMPILER MATCHES ".*arm-linux-gnueabihf.*" OR
        CMAKE_CXX_COMPILER MATCHES ".*arm-linux-gnueabihf.*" OR
        CMAKE_C_COMPILER MATCHES ".*arm-linux-gnu.*" OR
        CMAKE_CXX_COMPILER MATCHES ".*arm-linux-gnu.*")
    link_directories(3rd/mosquitto/arm/lib)
    #link_directories(../../common-rv1126/lib/mosquitto)
    link_directories(3rd/yaml-cpp/arm/lib)
    link_directories(3rd/openssl/arm/lib)
else()
    link_directories(3rd/mosquitto/x86_64/lib)
    link_directories(3rd/yaml-cpp/x86_64/lib)
endif()

# 添加软件版本号
#add_definitions(-DSYS_MANAGER_VERSION="v0.0.1")

# 添加编译器优化等级
add_compile_options(-O1)

# 添加可执行文件或库的编译规则
add_executable(${PROJECT_NAME} src/main.cpp)

target_link_libraries(${PROJECT_NAME}
                        PUBLIC mosquitto
                        PRIVATE ssl
                        PRIVATE crypto
                        PRIVATE yaml-cpp
                        PUBLIC  pthread
)



